﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core.Profile;
using COFE.IO;

namespace COFE.Core.Lister
{
    public static class IPrimaryDirectoryListerExtension
    {
        public static IFileSystemInfo ParsePath(this IPrimaryDirectoryLister pDirLister, string path, EntryConstructionFlags flags)
        {
            if (!flags.HasFlag(EntryConstructionFlags.CreateEntry))
                throw new ArgumentException("This extension method is meant to create an entry, use the another overload.");

            IFileSystemInfo retVal;
            if (pDirLister.ParsePath(path, flags, out retVal) != ParseResult.pNone)
                return retVal;

            return null;
        }

    }
}
